package com.apsfc.controller;

import com.apsfc.po.Admin;
import com.apsfc.po.Menus;
import com.apsfc.po.Notice;
import com.apsfc.po.User;
import com.apsfc.service.MenusService;
import com.apsfc.service.NoticeService;
import com.apsfc.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("qiantai")
public class MenuController {
    @Autowired
    @Qualifier("menusService")
    private MenusService menusService;

    @Autowired
    @Qualifier("noticeService")
    private NoticeService noticeService;

    @Autowired
    @Qualifier("usersService")
    private UsersService usersService;

    @RequestMapping("index")
    public String select(HttpSession session, HttpSession session2){
        List<Menus> menus = menusService.select();
        session.setAttribute("menus",menus);
        System.out.println(menus);

        List<Notice> notice = noticeService.getAllNotice();
        session2.setAttribute("notice",notice);
        System.out.println(notice);
        return "qiantai/index";
    }
}
